﻿<UserControl x:Class="EpiDashboard.DataRecodingControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
             mc:Ignorable="d" 
             xmlns:EpiDashboard="clr-namespace:EpiDashboard"
             Background="#00FFFFFF">    
    <Grid>        
            <Grid x:Name="ConfigGrid" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5,5,5,5" >
            <Rectangle Fill="#22000000" RadiusX="10" RadiusY="10" Margin="0,4,0,0" />
                <Rectangle Fill="#775C90B2" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" />
                <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="5,5,5,10" />
                    <StackPanel Orientation="Vertical" Margin="15" HorizontalAlignment="Center" VerticalAlignment="Top" >
                
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="138" />
                        <ColumnDefinition Width="227" />
                    </Grid.ColumnDefinitions>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />                        
                    </Grid.RowDefinitions>                    
                    
                    <TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Variable Definitions:" Margin="0,5,0,0" Grid.Row="0" Grid.Column="0"  Grid.ColumnSpan="2" />
                </Grid>

                <Grid Name="grdFormattingProperties" Width="Auto" HorizontalAlignment="Center" Margin="2,2,20,2" Visibility="Visible">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="2"/>
                            <RowDefinition Height="100"/>
                            <RowDefinition Height="7"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="15"/>

                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="45"/>
                            <ColumnDefinition Width="120"/>
                            <ColumnDefinition Width="50"/>
                            <ColumnDefinition Width="145"/>
                        </Grid.ColumnDefinitions>
                    
                        <ListBox x:Name="lbxRules" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="6" Width="357" />
                    <Grid Grid.ColumnSpan="4" Grid.Column="0" Grid.Row="3">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="115"/>
                                <ColumnDefinition Width="115"/>
                                <ColumnDefinition Width="115"/>
                        </Grid.ColumnDefinitions>

                        <Button x:Name="btnRemoveRule" Width="100" Content="Delete Variable" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left" Click="btnRemoveRule_Click" />
                        <Button x:Name="btnEditRule" Width="100" Content="Edit Variable" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Click="btnEditRule_Click" />
                        <Button x:Name="btnNewRule" Width="100" Content="New Variable" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Click="btnNewRule_Click" >
                            <Button.ContextMenu>
                                <ContextMenu>
                                    <MenuItem x:Name="mnuNewRecodeRule" Header="With Recoded Value" Click="mnuNewRecodeRule_Click" />
                                    <MenuItem x:Name="mnuNewSimpleAssignRule" Header="With Simple Assignment" Click="mnuNewSimpleAssignRule_Click" />
                                    <MenuItem x:Name="mnuNewConditionalAssignRule" Header="With Conditional Assignment" Click="mnuNewConditionalAssignRule_Click" />
                                    <MenuItem x:Name="mnuNewFormatRule" Header="With Formatted Value" Click="mnuNewFormatRule_Click" />
                                    <MenuItem x:Name="mnuNewExpressionAssignRule" Header="With Assigned Expression" Click="mnuNewExpressionAssignRule_Click" />
                                    <Separator/>
                                    <MenuItem x:Name="mnuNewGroupRule" Header="Create Variable Group" Click="mnuNewVariableGroupRule_Click" />
                                </ContextMenu>
                            </Button.ContextMenu>
                        </Button>
                        </Grid>
                </Grid>

                </StackPanel>
                    <TextBlock x:Name="txtTitle" HorizontalAlignment="Right" VerticalAlignment="Center"  TextAlignment="Center" Text="Defined Variables" Margin="0,0,-94,100" FontWeight="Bold" />
        </Grid>
    </Grid>
    
</UserControl>
